<include file="Public:header" />
<div class="content-box"><!-- Start Content Box -->
    <switch name="ACTION_NAME">
        <case value="edit">
            <script src="__ROOT__/Public/Js/xheditor/xheditor-zh-cn.min.js?v=1.1.1"></script>
<!--<link rel="stylesheet" href="__ROOT__/Public/Js/ui/development-bundle/demos/demos.css">-->
<script>

    $(pageInit);
    function pageInit()
    {
        $('#content').xheditor({skin:'nostyle',shortcuts:{'ctrl+enter':submitForm}});
    }

    function submitForm(){ $('#proform').submit(); }
</script>


            <div class="content-box-header">
                <h3>编辑单页</h3>
                <div class="clear"></div>
            </div> <!-- End .content-box-header -->
            <div class="content-box-content">

                <form name="pagesform" method="post" action="__URL__/doedit">
		<table border="0" cellspacing="1" >
			<tr>
				<th>ID</th>
				<td>{$id}<input type="hidden" name="id" value="{$id}"></td>
			</tr>
			<tr>
				<th>标题</th>
				<td><input type="text" name="title" value="{$title}"  /></td>
			</tr>
			<tr>
				<th>内容</th>
				<td>
                        <textarea id="content" name="content" class="xheditor-simple" rows="10" cols="90" >{$content}</textarea></td>
			</tr>
			<tr>
				<th>发布时间</th>
				<td><input type="text" name="postdate" value="{$postdate|date='Y-n-j H:i:s',###}"  /></td>
			</tr>
			<tr>
				<th>描述</th>
				<td><input type="text" name="description" value="{$description}"  /></td>
			</tr>
			<tr>
				<th>关键字</th>
				<td><input type="text" name="keywords" value="{$keywords}"  /></td>
			</tr>
		</table>
		<div align="center"><input type="submit" value="提交"  /></div>
		</form>
            </div>


        </case>
        <default />


        <div class="content-box-header">

            <h3>{$title}</h3>

            <ul class="content-box-tabs">
                <li><a href="#tab1" class="default-tab">列表</a></li>
                <li><a href="#tab2">添加</a></li>
            </ul>

            <div class="clear"></div>

        </div> <!-- End .content-box-header -->

        <div class="content-box-content">

            <div class="tab-content default-tab" id="tab1">
                <form name="pagesform" method="post" action="__URL__/batch">


                     <table>
                        <thead>
                            <tr>
                                <th><input class="check-all" type="checkbox" /></th>
				<th>标题</th>
				<th>发布时间</th>
				<th>操作</th>
                            </tr>
                        </thead>

                        <tbody>
                           <volist name="pgs" id="pg">
			<tr>
				<td><input name="id[]" type="checkbox" id="id[]" value="{$pg.id}"  /></td>
                                <td><a href="__URL__/edit/id/{$pg.id}">{$pg.title}</a></td>
				<td>{$pg.postdate|date="Y-n-j H:i:s",###}</td>
				<td><a href="__URL__/edit/id/{$pg.id}">编辑</a> <a href="__URL__/batch/act/delete/id/{$pg.id}">删除</a></td>
			</tr>
			</volist>
                        </tbody>

                        <tfoot>
                            <tr>
                                <td colspan="6">
                                    <div class="bulk-actions align-left">
                                        <select name="act">
                                            <option value="option1">请选择...</option>
                                            <option value="delete">删除</option>
                                        </select><input  class="button" type="submit" value="确定"  />

                                    </div>
                        <include file="Public:paging" />
                        <div class="clear"></div>
                        </td>
                        </tr>
                        </tfoot>
                    </table>

		</form>

            </div>

            <div class="tab-content" id="tab2">
                <form name="pagesform" method="post" action="__URL__/doadd">
		<table border="0" cellspacing="1" >
			<tr>
				<th>标题</th>
				<td><input type="text" name="title" value=""  /><input type="hidden" name="id" value="{$id}"/></td>
			</tr>
			<tr>
				<th>内容</th>
				<td><html:editor id="editor" name="content" type="FCKeditor" content="" /></td>
			</tr>
			<tr>
				<th>描述</th>
				<td><input type="text" name="description" value=""  /></td>
			</tr>
			<tr>
				<th>关键字</th>
				<td><input type="text" name="keywords" value=""  /></td>
			</tr>
		</table>
		<div align="center"><input type="submit" value="提交"  /></div>
		</form>

                        </div> <!-- End #tab2 -->
        </div> <!-- End .content-box-content -->
    </switch>
</div> <!-- End .content-box -->
<include file="Public:footer" />
